<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    /*内部样式不受影响*/
    /* div {
        font-size: 10px;
    } */
</style>
<body>
     <div style="font-size: 10px;" onclick="changeSize()">哈哈</div>
</body>
<script>
      function changeSize()
      {
        let element = document.querySelector('div');
        console.log(element.style);
        let size = parseInt(element.style.fontSize) + 10;
        // element.style.fontSize = size + "px";   
        element.style.cssText = "font-size: " + size + "px";
      }
      
</script>
</html>